/**
 * 创建自定义指令模块
 */

// 导出图片路径加载失败的处理指令
export const imageErr = {
  inserted(el, options) {
    el.src = el.src || options.value
    el.onerror = function() {
      el.src = options.value
    }
  },
  componentUpdated(el, options) {
    el.src = el.src || options.value
  }
}
